﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ECSS.Winform
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void btnService_Click(object sender, EventArgs e)
        {
            new Form1().Show();
        }

        private void btnDeliver_Click(object sender, EventArgs e)
        {
            new DispatchRequest().Show();
        }

        private void btnSubmitServiceRequest_Click(object sender, EventArgs e)
        {
            new ServiceRequest().Show();
        }

        private void btnConfirmLock_Click(object sender, EventArgs e)
        {
            new ConfirmLock().Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            new PayFinished().Show();
        }

        private void btnCancelBOSSOrder_Click(object sender, EventArgs e)
        {
            new FrmCancelBossOrders().Show();
        }

        private void flowLayoutPanel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void btnEndServiceDeliver_Click(object sender, EventArgs e)
        {
            new FrmEndServiceDeliver().Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            new FrmDispatchFailButServiceFinished().Show();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            //手工对账，只能在244上使用
            new TrandeAccount().Show();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {

        }

        private void MnuCancelBossOrderLog_Click(object sender, EventArgs e)
        {
            new FrmAnalysisCancelOrderLog().Show();
        }

        private void MnuOrderAndOfferingServicesDiff_Click(object sender, EventArgs e)
        {
            ExamineECSS ecss = new ExamineECSS();

            StringBuilder sb = new StringBuilder();

            sb.Append(string.Format("{0}巡检商品业务数与订单业务数不一致结果:\r\n", DateTime.Now.ToString()));

            foreach (string s in ecss.GetOrderIdAndOfferingId())
            {
                sb.Append(string.Format("{0}\r\n", s));
            }

            textBox1.Text = sb.ToString();
        }

        private void 批量取消预订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new FrmCancelBossOrders().Show();
        }

        private void 业务受理完成通知ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new Form1().Show();
        }

        private void 提交配送请求ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new DispatchRequest().Show();
        }

        private void 库存锁定确认ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new ConfirmLock().Show();
        }

        private void 提交业务受理请求ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new ServiceRequest().Show();
        }

        private void 支付完成通知ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new PayFinished().Show();
        }

        private void 批量处理约束失败的订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new FrmFinishServicesFail().Show();
        }

        private void 重新生成BOSS预订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //new FrmReCreateBOSSOrder().Show();
        }

        private void 批量入账资格认证预约订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new ResOrderEntryAccount().Show();
        }

        private void 批量通知开始业务受理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new ServiceRequest().Show();
        }

        private void 批量重新生成资格认证类预订单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new ReBuildBossOrder().Show();
        }

    }
}
